package guitar

import (
	"context"

	"go-weixin/app/guitar/api/internal/svc"
	"go-weixin/app/guitar/api/internal/types"

	"github.com/zeromicro/go-zero/core/logx"
)

type GuitarCsvLogic struct {
	logx.Logger
	ctx    context.Context
	svcCtx *svc.ServiceContext
}

func NewGuitarCsvLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GuitarCsvLogic {
	return &GuitarCsvLogic{
		Logger: logx.WithContext(ctx),
		ctx:    ctx,
		svcCtx: svcCtx,
	}
}

func (l *GuitarCsvLogic) GuitarCsv(req *types.GuitarCsvReq) (resp *types.GuitarCsvResp, err error) {
	var csvData [][]string
	// var csvDataRowJoin []string
	// var csvDataString string

	csvData = [][]string{
		{"Name", "Age", "City"},
		{"John", "30", "New York"},
		{"Alice", "25", "London"},
		{"Bob", "35", "Paris"},
	}
	// for _, v := range csvData {
	// 	csvDataRowJoin = append(csvDataRowJoin, strings.Join(v, ","))
	// }

	// csvDataString = strings.Join(csvDataRowJoin, "\n")

	resp = new(types.GuitarCsvResp)
	resp.CsvData = csvData
	// resp.CsvData = []byte(csvDataString)
	return
}
